/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package client;

import mail.Message;
import server.MailServer;

/**
 *
 * @author Lab-214-21
 */
public class MailClient {
private String nombre;
private MailServer server;
    public MailClient(MailServer s,String nombre ) {
        this.nombre = nombre;
        server= s;
    }
    
    
    public int checkmessages(){
        return server.getMessagesWaiting(nombre);
    }
    
    public Message readNextMessage(){
        return server.getNextMessage(nombre);
    }
    
   public void sendMessage(Message m){
     server.post(m);
   }
    
}
